home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / complib / sscalm1d.z / sscalm1d
Text File  |  1998-10-30  |  7KB  |  133 lines

  1.  
  2.  
  3.  
  4. ssssssssccccaaaallllmmmm1111dddd,,,,ddddssssccccaaaallllmmmm1111dddd((((3333FFFF))))                                    ssssssssccccaaaallllmmmm1111dddd,,,,ddddssssccccaaaallllmmmm1111dddd((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ssssssssccccaaaallllmmmm1111dddd,,,, ddddssssccccaaaallllmmmm1111dddd ---- scales Multiple 1D real sequences.
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSYYYYSSSS
  12.      _F_o_r_t_r_a_n :
  13.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ssssssssccccaaaallllmmmm1111dddd(((( nnnn,,,, pppp,,,, aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy,,,, iiiinnnncccc,,,, llllddddaaaa))))
  14.           iiiinnnntttteeeeggggeeeerrrr            nnnn,,,, pppp,,,, iiiinnnncccc,,,, llllddddaaaa
  15.           rrrreeeeaaaallll               aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy((((llllddddaaaa,,,,pppp))))
  16.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ddddssssccccaaaallllmmmm1111dddd(((( nnnn,,,, pppp,,,, aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy,,,, iiiinnnncccc,,,, llllddddaaaa))))
  17.           iiiinnnntttteeeeggggeeeerrrr            nnnn,,,, pppp,,,, iiiinnnncccc,,,, llllddddaaaa
  18.           rrrreeeeaaaallll****8888             aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy((((llllddddaaaa,,,,pppp))))
  19.  
  20.      _C :
  21.      ####iiiinnnncccclllluuuuddddeeee <<<<fffffffftttt....hhhh>>>>
  22.      iiiinnnntttt ssssssssccccaaaallllmmmm1111dddd (((( iiiinnnntttt nnnn,,,, iiiinnnntttt pppp,,,, ffffllllooooaaaatttt aaaallllpppphhhhaaaa,,,, ffffllllooooaaaatttt ****aaaarrrrrrrraaaayyyy,,,,
  23.                iiiinnnntttt iiiinnnncccc,,,, iiiinnnntttt llllddddaaaa))));;;;
  24.      iiiinnnntttt ddddssssccccaaaallllmmmm1111dddd (((( iiiinnnntttt nnnn,,,, iiiinnnntttt pppp,,,, ddddoooouuuubbbblllleeee aaaallllpppphhhhaaaa,,,, ddddoooouuuubbbblllleeee ****aaaarrrrrrrraaaayyyy,,,,
  25.                iiiinnnntttt iiiinnnncccc,,,, iiiinnnntttt llllddddaaaa))));;;;
  26.  
  27.  
  28. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  29.      ssssssssccccaaaallllmmmm1111dddd and ddddssssccccaaaallllmmmm1111dddd scale the P real sequences of N samples each.
  30.      The Fourier Transforms are not normalized so the succession Direct-
  31.      Inverse transform scales the input data by a factor equal to the size of
  32.      the transform.  Often ssssssssccccaaaallllmmmm1111dddd or ddddssssccccaaaallllmmmm1111dddd are used to scale back the
  33.      result.
  34.  
  35. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  36.      NNNN Integer, the number of samples in each sequence.  Unchanged on exit.
  37.  
  38.      PPPP Integer, the number of sequences.  Unchanged on exit.
  39.  
  40.      AAAAllllpppphhhhaaaa scaling floating point value.
  41.  
  42.      AAAARRRRRRRRAAAAYYYY Array containing the samples of the sequence to be scaled (in
  43.      place0.
  44.  
  45.      IIIINNNNCCCC Integer, increment between two consecutive elements of a sequence.
  46.      Unchanged on exit.
  47.  
  48.      LLLLDDDDAAAA Integer, leading dimension: increment between the first samples of
  49.      two consecutive sequences.  Unchanged on exit.
  50.  
  51.  
  52. EEEExxxxaaaammmmpppplllleeee ooooffff CCCCaaaalllllllliiiinnnngggg SSSSeeeeqqqquuuueeeennnncccceeee
  53.      Working on 64 sequences of 1024 real values each.  We successively apply
  54.      a Direct Fourier Transform, an Inverse Fourier Trasnform and finally
  55.      scale back the result by a factor 1/N (1/1024.)-
  56.      This sequence DirectFFT-InverseFFT-Scaling is equivalent to the identity
  57.      operator and the final sequence should be equal (with round-off
  58.      precision) to the initial sequence.
  59.      Elements of each sequence are stored with increment (stride) 1, and the
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssssssccccaaaallllmmmm1111dddd,,,,ddddssssccccaaaallllmmmm1111dddd((((3333FFFF))))                                    ssssssssccccaaaallllmmmm1111dddd,,,,ddddssssccccaaaallllmmmm1111dddd((((3333FFFF))))
  71.  
  72.  
  73.  
  74.      offset between the first element of two succesive sequence (leading
  75.      dimension) is 1026 (1026 >= 1024+2).
  76.      _F_o_r_t_r_a_n
  77.           real array(0:1026-1,0:64-1), coeff(1024+15)
  78.           call scfftm1dui( 1024, coeff)
  79.           call scfftm1du( -1, 1024, 64, array, 1, 1026, coeff)
  80.           call csfftm1du(  1, 1024, 64, array, 1, 1026, coeff)
  81.           call sscalm1d(1024,64,(1./real(1024)),array,1,1026)
  82.  
  83.      _C
  84.           #include <fft.h>
  85.           float array[64*1026], *coeff;
  86.           coeff = scfftm1dui( 1024, NULL);
  87.           scfftm1du( -1, 1024, 64, array, 1, 1026, coeff);
  88.           csfftm1du(  1, 1024, 64, array, 1, 1026, coeff);
  89.           sscalm1d( 1024, 64, 1./(float)1024, array, 1, 1026);
  90.  
  91.      NNNNOOOOTTTTEEEE____1111 :::: The Direct and Inverse transforms should use opposite signs -
  92.      Which one is used (+1 or -1) for Direct transform is just a matter of
  93.      convention-
  94.  
  95.      NNNNOOOOTTTTEEEE____2222 :::: The Fourier Transforms are not normalized so the succession
  96.      Direct-Inverse transform scales the input data by a factor equal to the
  97.      size of the transform.
  98.  
  99. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  100.      fft, scfftm1dui, dzfftm1dui, scfftm1du, dzfftm1du, csfftm1du, zdfftm1du,
  101.      sprodm1du, dprodm1du
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.